﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Infrastructure.Migrations
{
    public partial class log4 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "CreatedBy",
                table: "TraceabilityInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "CreatedTime",
                table: "TraceabilityInfos",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<int>(
                name: "DeletedBy",
                table: "TraceabilityInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "DeletedTime",
                table: "TraceabilityInfos",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "LastModifiedBy",
                table: "TraceabilityInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "LastModifiedTime",
                table: "TraceabilityInfos",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "CreatedBy",
                table: "SlaughterInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "CreatedTime",
                table: "SlaughterInfos",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<int>(
                name: "DeletedBy",
                table: "SlaughterInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "DeletedTime",
                table: "SlaughterInfos",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "LastModifiedBy",
                table: "SlaughterInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "LastModifiedTime",
                table: "SlaughterInfos",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "CreatedBy",
                table: "ImageInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "CreatedTime",
                table: "ImageInfos",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<int>(
                name: "DeletedBy",
                table: "ImageInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "DeletedTime",
                table: "ImageInfos",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "LastModifiedBy",
                table: "ImageInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "LastModifiedTime",
                table: "ImageInfos",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "CreatedBy",
                table: "HealthCareInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "CreatedTime",
                table: "HealthCareInfos",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<int>(
                name: "DeletedBy",
                table: "HealthCareInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "DeletedTime",
                table: "HealthCareInfos",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "LastModifiedBy",
                table: "HealthCareInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "LastModifiedTime",
                table: "HealthCareInfos",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AlterColumn<bool>(
                name: "IsDeleted",
                table: "EnterpriseInfos",
                type: "bit",
                nullable: false,
                defaultValue: false,
                oldClrType: typeof(bool),
                oldType: "bit",
                oldNullable: true);

            migrationBuilder.AddColumn<int>(
                name: "CreatedBy",
                table: "EnterpriseInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "CreatedTime",
                table: "EnterpriseInfos",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<int>(
                name: "DeletedBy",
                table: "EnterpriseInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "DeletedTime",
                table: "EnterpriseInfos",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "LastModifiedBy",
                table: "EnterpriseInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "LastModifiedTime",
                table: "EnterpriseInfos",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "CreatedBy",
                table: "DeepProcessingInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "CreatedTime",
                table: "DeepProcessingInfos",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<int>(
                name: "DeletedBy",
                table: "DeepProcessingInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "DeletedTime",
                table: "DeepProcessingInfos",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "LastModifiedBy",
                table: "DeepProcessingInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "LastModifiedTime",
                table: "DeepProcessingInfos",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "CreatedBy",
                table: "BreedingInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "CreatedTime",
                table: "BreedingInfos",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<int>(
                name: "DeletedBy",
                table: "BreedingInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "DeletedTime",
                table: "BreedingInfos",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "LastModifiedBy",
                table: "BreedingInfos",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "LastModifiedTime",
                table: "BreedingInfos",
                type: "datetime2",
                nullable: true);

            migrationBuilder.CreateTable(
                name: "UserInfos",
                columns: table => new
                {
                    UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    Username = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Password = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    RealName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Gender = table.Column<int>(type: "int", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: false),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatedBy = table.Column<int>(type: "int", nullable: false),
                    LastModifiedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifiedBy = table.Column<int>(type: "int", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedBy = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserInfos", x => x.UserId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "UserInfos");

            migrationBuilder.DropColumn(
                name: "CreatedBy",
                table: "TraceabilityInfos");

            migrationBuilder.DropColumn(
                name: "CreatedTime",
                table: "TraceabilityInfos");

            migrationBuilder.DropColumn(
                name: "DeletedBy",
                table: "TraceabilityInfos");

            migrationBuilder.DropColumn(
                name: "DeletedTime",
                table: "TraceabilityInfos");

            migrationBuilder.DropColumn(
                name: "LastModifiedBy",
                table: "TraceabilityInfos");

            migrationBuilder.DropColumn(
                name: "LastModifiedTime",
                table: "TraceabilityInfos");

            migrationBuilder.DropColumn(
                name: "CreatedBy",
                table: "SlaughterInfos");

            migrationBuilder.DropColumn(
                name: "CreatedTime",
                table: "SlaughterInfos");

            migrationBuilder.DropColumn(
                name: "DeletedBy",
                table: "SlaughterInfos");

            migrationBuilder.DropColumn(
                name: "DeletedTime",
                table: "SlaughterInfos");

            migrationBuilder.DropColumn(
                name: "LastModifiedBy",
                table: "SlaughterInfos");

            migrationBuilder.DropColumn(
                name: "LastModifiedTime",
                table: "SlaughterInfos");

            migrationBuilder.DropColumn(
                name: "CreatedBy",
                table: "ImageInfos");

            migrationBuilder.DropColumn(
                name: "CreatedTime",
                table: "ImageInfos");

            migrationBuilder.DropColumn(
                name: "DeletedBy",
                table: "ImageInfos");

            migrationBuilder.DropColumn(
                name: "DeletedTime",
                table: "ImageInfos");

            migrationBuilder.DropColumn(
                name: "LastModifiedBy",
                table: "ImageInfos");

            migrationBuilder.DropColumn(
                name: "LastModifiedTime",
                table: "ImageInfos");

            migrationBuilder.DropColumn(
                name: "CreatedBy",
                table: "HealthCareInfos");

            migrationBuilder.DropColumn(
                name: "CreatedTime",
                table: "HealthCareInfos");

            migrationBuilder.DropColumn(
                name: "DeletedBy",
                table: "HealthCareInfos");

            migrationBuilder.DropColumn(
                name: "DeletedTime",
                table: "HealthCareInfos");

            migrationBuilder.DropColumn(
                name: "LastModifiedBy",
                table: "HealthCareInfos");

            migrationBuilder.DropColumn(
                name: "LastModifiedTime",
                table: "HealthCareInfos");

            migrationBuilder.DropColumn(
                name: "CreatedBy",
                table: "EnterpriseInfos");

            migrationBuilder.DropColumn(
                name: "CreatedTime",
                table: "EnterpriseInfos");

            migrationBuilder.DropColumn(
                name: "DeletedBy",
                table: "EnterpriseInfos");

            migrationBuilder.DropColumn(
                name: "DeletedTime",
                table: "EnterpriseInfos");

            migrationBuilder.DropColumn(
                name: "LastModifiedBy",
                table: "EnterpriseInfos");

            migrationBuilder.DropColumn(
                name: "LastModifiedTime",
                table: "EnterpriseInfos");

            migrationBuilder.DropColumn(
                name: "CreatedBy",
                table: "DeepProcessingInfos");

            migrationBuilder.DropColumn(
                name: "CreatedTime",
                table: "DeepProcessingInfos");

            migrationBuilder.DropColumn(
                name: "DeletedBy",
                table: "DeepProcessingInfos");

            migrationBuilder.DropColumn(
                name: "DeletedTime",
                table: "DeepProcessingInfos");

            migrationBuilder.DropColumn(
                name: "LastModifiedBy",
                table: "DeepProcessingInfos");

            migrationBuilder.DropColumn(
                name: "LastModifiedTime",
                table: "DeepProcessingInfos");

            migrationBuilder.DropColumn(
                name: "CreatedBy",
                table: "BreedingInfos");

            migrationBuilder.DropColumn(
                name: "CreatedTime",
                table: "BreedingInfos");

            migrationBuilder.DropColumn(
                name: "DeletedBy",
                table: "BreedingInfos");

            migrationBuilder.DropColumn(
                name: "DeletedTime",
                table: "BreedingInfos");

            migrationBuilder.DropColumn(
                name: "LastModifiedBy",
                table: "BreedingInfos");

            migrationBuilder.DropColumn(
                name: "LastModifiedTime",
                table: "BreedingInfos");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDeleted",
                table: "EnterpriseInfos",
                type: "bit",
                nullable: true,
                oldClrType: typeof(bool),
                oldType: "bit");
        }
    }
}
